package com.neuedu.springbootmy12306.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.neuedu.springbootmy12306.entity.Category;
import com.neuedu.springbootmy12306.service.CategoryService;

@Controller
public class CategoryController {
	@Autowired
	private CategoryService categoryService;

	@RequestMapping("categoyry/listall")
	@ResponseBody
	public List<Category> listCategories() {
		return categoryService.findAll();
	}
}
